package com.sunronsoft.mind.map;

import com.jfinal.captcha.CaptchaRender;

/**
 * @author Sunron
 **/
public class MyCaptchaRender extends CaptchaRender {

    // 验证码随机字符数组
    protected static final char[] charArray = "0123456789".toCharArray();

    public MyCaptchaRender() {
        MyCaptchaRender.setCaptchaName("login_captcha");
    }

    @Override
    protected String getRandomString() {
        char[] randomChars = new char[4];
        for (int i = 0; i < randomChars.length; i++) {
            randomChars[i] = charArray[random.nextInt(charArray.length)];
        }
        return String.valueOf(randomChars);
    }
}
